import type { ProColumns } from '@ant-design/pro-table';
export type columnsDataType = {
  order: number,
  acName: string,
  custNo: string,
  acNo: string,
  balance: string,
  custType: string,
  openAcDate: string,
  status: string,
  startTime: string,
  endTime: string
};

const columnsData: ProColumns<columnsDataType>[] = [

  // 配置搜索框
  {
    title: '账户名',
    dataIndex: 'acName',
    hideInTable: true,
    fieldProps: {
      maxLength: 20
    },
  },
  {
    title: '账户号',
    dataIndex: 'acNo',
    hideInTable: true,
    fieldProps: {
      maxLength: 20
    },
  },
  {
    title: '账户状态',
    dataIndex: 'status',
    valueType: 'select',
    hideInTable: true,
    valueEnum: {
      0: {
        text: '正常'
      },
      // 1: {
      //   text: '未激活'
      // },
      // 2: {
      //   text: '挂失'
      // },
      3: {
        text: '冻结'
      },
      // 4: {
      //   text: '销户'
      // },
      // 5: {
      //   text: '锁定'
      // }
    },
  },
  {
    title: '开户日期',
    dataIndex: 'registerDate',
    valueType: 'dateRange',
    colSize: 1,
    hideInTable: true,
    search: {
      transform: (value) => {
        return {
          startTime: value[0],
          endTime: value[1],
        }; 1
      },
    },
  },

  // table里面的内容
  {
    title: '序号',
    width: 50,
    fixed: 'left',
    dataIndex: 'order',
    valueType: 'indexBorder',
    hideInSearch: true,
  },
  {
    title: '账户名',
    width: 160,
    fixed: 'left',
    dataIndex: 'acName',
    hideInSearch: true,
  },
  {
    title: '会员号',
    width: 160,
    dataIndex: 'custNo',
    hideInSearch: true,
  },
  {
    title: '账户号',
    dataIndex: 'acNo',
    width: 160,
    hideInSearch: true,
  },
  {
    title: '余额',
    width: 140,
    dataIndex: 'balance',
    hideInSearch: true,
  },
  {
    title: '币种',
    width: 80,
    renderText: () => 'HPC',
    hideInSearch: true,
  },
  {
    title: '和平币在途余额',
    width: 120,
    dataIndex: 'roadHpcBalance',
    hideInSearch: true,
  },
  {
    title: '币种',
    width: 80,
    renderText: () => 'HPC',
    hideInSearch: true,
  },
  {
    title: '法币在途余额',
    width: 120,
    dataIndex: 'roadCadBalance',
    hideInSearch: true,
  },
  {
    title: '币种',
    width: 80,
    renderText: () => 'CAD',
    hideInSearch: true,
  },
  {
    title: '开户时间',
    width: 160,
    dataIndex: 'openAcDate',
    hideInSearch: true,
    valueType: 'dateTime',
  },
  {
    title: '账号状态',
    width: 100,
    hideInSearch: true,
    dataIndex: 'status',
    valueType: 'select',
    valueEnum: {
      0: {
        text: '正常',
        status: 'Success',
      },
      1: {
        text: '未激活',
        status: 'Default',
      },
      2: {
        text: '挂失',
        status: 'Processing',
      },
      3: {
        text: '冻结',
        status: 'Error',
      },
      4: {
        text: '销户',
        status: 'Warning',
      },
      5: {
        text: '锁定',
        status: 'Error',
      }
    },
  },
  {
    title: '操作',
    width: 100,
    fixed: 'right',
    hideInSearch: true,
    dataIndex: 'action',
  },
];

export default columnsData;